import request from '@/utils/request'
import { getItem } from '@/utils/auth'

export function fetchParameterApplicationListByApplicationID(data) {
  return request({
    url: '/cloud-system/getParameterApplicationListByApplicationID',
    method: 'post',
    data
  })
}
// 获取列表数据
export function fetchListData(data) {
  return request({
    url: '/cloud-system/getParameterSystemList',
    method: 'post',
    data
  })
}
// 获取某一条详情
export function getOneDetail(data) {
  return request({
    url: '/cloud-system/getOneParameterSystemDetail',
    method: 'post',
    data
  })
}

// 创建数据
export function createData(data) {
  return request({
    url: '/cloud-system/createOneParameterSystem',
    method: 'post',
    data
  })
}

// 编辑数据
export function editData(data) {
  return request({
    url: '/cloud-system/updateOneParameterSystem',
    method: 'post',
    data
  })
}

// 删除数据
export function deleteData(data) {
  return request({
    url: '/cloud-system/deleteOneParameterSystem',
    method: 'post',
    data
  })
}

// 批量删除数据
export function batchDeleteData(data) {
  return request({
    url: '/cloud-system/batchDeleteParameterSystem',
    method: 'post',
    data
  })
}

// 锁定数据
export function lockData(data) {
  return request({
    url: '/cloud-system/lockOneParameterSystem',
    method: 'post',
    data
  })
}

// 解锁数据
export function unlockData(data) {
  return request({
    url: '/cloud-system/unlockOneParameterSystem',
    method: 'post',
    data
  })
}

// 批量锁定数据
export function batchLockData(data) {
  return request({
    url: '/cloud-system/batchLockParameterSystem',
    method: 'post',
    data
  })
}
// 批量解锁定数据
export function batchUnLockData(data) {
  return request({
    url: '/cloud-system/batchUnLockParameterSystem',
    method: 'post',
    data
  })
}

export function getParameterList(baseParam) {
  const data = Object.assign(JSON.parse(getItem('baseParam')), baseParam)
  return request({
    url: '/cloud-system/getParameterList',
    method: 'post',
    data: data
  })
}



